﻿//========================================================================//
//      Copyright 2012, Smilodon Studio Inc.
//      All rights reserved.
//========================================================================//

/**
 *	color
 *      @author: CYS
 */


var Color = function(r, g, b, a)
{
	this.r = r || 1;
	this.g = g || 1;
	this.b = b || 1;
	this.a = a || 1;
}  

Color.prototype.setRGB = function(r, g, b) {this.r = r; this.g = g; this.b = b;}
Color.prototype.setR = function(r) {this.r = r;}
Color.prototype.setG = function(g) {this.g = g;}
Color.prototype.setB = function(b) {this.b = b;}
Color.prototype.setAlpha = function(a) {this.a = a;}

Color.prototype.getValue = function()
{
	return rgba(Math.floor(this.r*256), Math.floor(this.g*256), Math.floor(this.b*256), this.a);
}